<template>
	<view class="body">
		<view class="headBox">
			<view class="bgBox">

				<view class="ImgBox">
					<navigator url="#">
						<image :src="qaImgUrl" class="iconImg" mode="aspectFill"></image>
					</navigator>
					<navigator url="#">
						<image :src="noticeImg" class="iconImg" mode="aspectFill"></image>
					</navigator>
				</view>
			</view>

		</view>
		<view class="content">
			<view class="bgBox_c">
				<text class="title">每30秒自动刷新</text>
				<view class="QRBox">
					<image :src="qrImg" class="QRImg" @click="GetQrCode()"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	let settimeout=null;
	export default {
		data() {
			return {
				msg: 'hello',
				flag: false,
				imgUrl: '/static/icon/QRcodeIcon.png',
				qaImgUrl: '/static/Img/QAImg.png',
				noticeImg: '/static/Img/NoticeImg.png',
				qrImg: '/static/Img/QRCodeDemo.png',
				timer: null
			}
		},
		onShow() {
			this.GetQrCode();
		},
		onLoad() {
			settimeout=setInterval(()=>{
				this.GetQrCode();
			},30000)
		},
		methods: {
			// 获取页面数据
			GetQrCode() {
				let loginToken = uni.getStorageSync('login');
				var studentId = loginToken.id;
				let datatime=new Date();
				this.qrImg = this.$httpUrl + '/QrCodeProc/GetQrCode?studentId=' + studentId+"&date="+datatime.getTime();
				
				console.log(this.qrImg,'this.qrImg');
			}
		}
	}
</script>

<style>
	page {
		height: 100%;
		background: #1c81fd;
	}

	/* .body {
		width: 750rpx;
		height: 100%;
	}
 */
	.headBox {
		/* align-items: center; */
		position: relative;
		height: 17vh;
	}

	.bgBox {
		width: 600rpx;
		height: 17vh;
		position: absolute;
		left: 75rpx;
		top: 5vh;
		background-color: #FFFFFF;
		border-radius: 20rpx;
		box-shadow: 2rpx 5rpx 10rpx #27347d;
		/* z-index: 0; */
		/* background-color: rgba(255, 255, 255, 0.9); */
	}



	.iconImg {
		/* position: relative;
		left: 100rpx;
		top: 6vh; */

		width: 225rpx;
		height: 175rpx;
		margin: 15rpx 30rpx;

		float: left;
	}

	.content {
		position: relative;
		height: 65vh;
	}

	.bgBox_c {
		height: 50vh;
		width: 80vw;
		position: absolute;
		left: 10vw;
		top: 10vh;
		background-color: #FFFFFF;
		border-radius: 20rpx;
		box-shadow: 2rpx 5rpx 10rpx #27347d;
		text-align: center;
	}

	.title {
		color: #858585;
		font-size: 40rpx;
		line-height: 5vh;
		height: 5vh;
	}

	.QRBox {
		margin: 30rpx auto;
		width: 495rpx;
		height: 497.9rpx;
		background-image: url(../../static/Img/QRbroder .png);
		background-size: contain;
	}

	.QRImg {
		width: 460rpx;
		height: 460rpx;
		margin-top: 14rpx;
	}
</style>
